<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>ASP.NET</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/ASP.NET"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-ASP_NET rootpage-ASP_NET skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">ASP.NET</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr"><div class="infobox_v3 infobox infobox--frwiki noarchive" style="width:260px">
<div class="entete icon informatique" style="color: #000000;"><style data-mw-deduplicate="TemplateStyles:r228712691">
/* start https://fr.wikipedia.org/ */
.mw-parser-output .entete.informatique{background-image:url("./_mw_/Picto.nfo.png")}
/* end https://fr.wikipedia.org/ */
</style>
<div>ASP.NET</div>
</div>
<p class="mw-empty-elt">
</p>
<table><caption style="color:#000000;">Informations</caption>
<tbody><tr>
<th scope="row"><a href="D%C3%A9veloppeur" title="Développeur">Développé par</a></th>
<td>
<a href="Microsoft" title="Microsoft">Microsoft</a></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Première version</a>
</th>
<td>
<time class="nowrap" datetime="2002-01" data-sort-value="2002-01">Janvier 2002</time></td>
</tr>
<tr>
<th scope="row"> <a href="Version_d'un_logiciel" title="Version d'un logiciel">Dernière version</a>
</th>
<td>
4.8.1 (<time class="nowrap" datetime="2022-08-09" data-sort-value="2022-08-09">9 août 2022</time>)</td>
</tr>
<tr>
<th scope="row"><a href="D%C3%A9p%C3%B4t_(informatique)" title="Dépôt (informatique)">Dépôt</a></th>
<td>
<span class="wd_p1324"><a rel="nofollow" class="external text" href="https://github.com/aspnet/AspNetWebStack">github.com/aspnet/AspNetWebStack</a></span></td>
</tr>
<tr>
<th scope="row"><a href="Plateforme_informatique" title="Plateforme informatique">Environnement</a></th>
<td>
<a href="Microsoft_Windows" title="Microsoft Windows">Microsoft Windows</a></td>
</tr>
<tr>
<th scope="row"> Type
</th>
<td>
<a href="Programmation_web" title="Programmation web">programmation web</a></td>
</tr>
<tr>
<th scope="row"><a href="Licence_de_logiciel" title="Licence de logiciel">Licence</a></th>
<td>
<a href="Logiciel_propri%C3%A9taire" title="Logiciel propriétaire">propriétaire</a>, <a href="Licence_Apache" title="Licence Apache">Licence Apache</a> depuis la version 5<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></td>
</tr>
<tr>
<th scope="row"><a href="Site_web" title="Site web">Site web</a></th>
<td>
<a rel="nofollow" class="external text" href="http://www.asp.net">www.asp.net</a></td>
</tr>
</tbody></table>
<p class="bloc">Chronologie des versions</p>
<p class="overflow infobox-navigateur navigation-not-searchable" style=""><span class="prev_bloc"><a href="Active_Server_Pages" title="Active Server Pages">ASP</a></span> <span class="next_bloc"><a href="ASP.NET_Core" title="ASP.NET Core">ASP.NET Core</a></span></p>
</div>
<div class="infobox_v3 infobox infobox--frwiki noarchive large"><div class="entete icon informatique" style="background-color:#C0C0C0"><div>ASP.NET</div></div><table><caption style="text-align:center;background-color:#C0C0C0">Caractéristiques</caption><tbody><tr class=""><th scope="row"><a href="Extension_de_nom_de_fichier" title="Extension de nom de fichier">Extension</a></th><td class=""><div>
.aspx, .ascx, .ashx</div></td></tr><tr class=""><th scope="row"><a href="Type_de_m%C3%A9dias" title="Type de médias">Type MIME</a></th><td class=""><div>
text/html</div></td></tr><tr class=""><th scope="row">Développé par</th><td class=""><div>
<a href="Microsoft" title="Microsoft">Microsoft</a></div></td></tr><tr class=""><th scope="row">Version initiale</th><td class=""><div>
<span class="wd_p571"><time class="nowrap date-lien" datetime="2002-01" data-sort-value="2002-01"><a href="Janvier_2002" title="Janvier 2002">Janvier</a> <a href="2002" title="2002">2002</a></time></span></div></td></tr><tr class=""><th scope="row">Site web</th><td class=""><div>
<span class="wd_p856"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> <a rel="nofollow" class="external text" href="https://dotnet.microsoft.com/en-us/apps/aspnet">dotnet.microsoft.com/en-us/apps/aspnet</a></span></div></td></tr></tbody></table></div>
<p><b>ASP.NET</b> est un <a href="Framework" title="Framework">framework</a> permettant de générer <a href="Page_web_dynamique" title="Page web dynamique">à la demande des pages web</a>, lancé par <a href="Microsoft" title="Microsoft">Microsoft</a> en <time class="nowrap" datetime="2000-07" data-sort-value="2000-07">juillet 2000</time><sup id="cite_ref-liberty_2-0" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>, et utilisé pour mettre en œuvre des <a href="Applications_web" class="mw-redirect" title="Applications web">applications web</a><sup id="cite_ref-weissinger_3-0" class="reference"><a href="#cite_note-weissinger-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Il s'agit d'une évolution d'<a href="Active_Server_Pages" title="Active Server Pages">Active Server Pages</a> (ASP, alias Classic ASP), par laquelle cette technique a été incorporée dans la plateforme <a href="Microsoft_.NET" title="Microsoft .NET">Microsoft .NET</a><sup id="cite_ref-mitchell_4-0" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>.
</p><p>Le moteur d'ASP.NET est un filtre branché sur le serveur web <a href="Internet_Information_Services" title="Internet Information Services">Internet Information Services</a> (IIS). Il est distribué avec le <a href="Framework_.NET" class="mw-redirect" title="Framework .NET">framework .NET</a>. ASP.NET peut être utilisé avec n'importe quel <a href="Langage_de_programmation" title="Langage de programmation">langage de programmation</a> pour la plateforme .NET (<a href="Visual_Basic_.NET" title="Visual Basic .NET">Visual Basic .NET</a>, <a href="C_sharp" class="mw-redirect" title="C sharp">C#</a>, <a href="JScript" title="JScript">JScript</a><sup id="cite_ref-mitchell_4-1" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>…).
</p>
<div class="mw-heading mw-heading2"><h2 id="Principes">Principes</h2></div>
<p>ASP.NET est un <a href="Framework" title="Framework">framework</a> permettant de générer des <a href="Page_web_dynamique" title="Page web dynamique">pages web dynamiques</a>. Une page ASP.NET est composée de deux parties : d'un côté du code <a href="Hypertext_Markup_Language" title="Hypertext Markup Language">HTML</a>, et de l'autre des instructions de programme<sup id="cite_ref-weissinger_3-1" class="reference"><a href="#cite_note-weissinger-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Ces instructions sont utilisées pour générer le résultat d'une demande de page qui sera envoyée au <a href="Navigateur_web" title="Navigateur web">navigateur web</a>. Le résultat que reçoit le navigateur est du HTML ordinaire<sup id="cite_ref-ullman_5-0" class="reference"><a href="#cite_note-ullman-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>. Une page ASP.NET comporte des <i>Web controls</i> — des portions d'HTML qui peuvent être modifiées par programmation<sup id="cite_ref-mitchell_4-2" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>.
</p><p>Le moteur d'ASP.NET est un filtre, branché sur le <a href="Serveur_web" title="Serveur web">serveur web</a> IIS par son interface de programmation <a href="ISAPI" title="ISAPI">ISAPI</a><sup id="cite_ref-weissinger_3-2" class="reference"><a href="#cite_note-weissinger-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Le moteur ASP.NET est distribué avec le framework .NET<sup id="cite_ref-mitchell_4-3" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. Il peut être utilisé avec n'importe quel langage de programmation pour la plateforme .NET (<a href="Visual_Basic_.NET" title="Visual Basic .NET">Visual Basic .NET</a>, <a href="C_sharp" class="mw-redirect" title="C sharp">C#</a>, <a href="JScript" title="JScript">JScript</a><sup id="cite_ref-mitchell_4-4" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>…). Les <a href="Site_web" title="Site web">sites web</a> ASP.NET sont couramment développés en utilisant un serveur web simplifié, installé sur l'ordinateur personnel du développeur<sup id="cite_ref-mitchell_4-5" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Successeur_d'ASP"><span id="Successeur_d.27ASP"></span>Successeur d'ASP</h3></div>
<p>ASP.NET est une évolution majeure d'ASP par laquelle il a été incorporé dans la plateforme .NET<sup id="cite_ref-mitchell_4-6" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>.
</p><p>Il y a des différences significatives entre ASP.NET et son prédécesseur ASP<sup id="cite_ref-liberty_2-1" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> :
</p>
<ul><li>en ASP.NET les programmes sont compilés, alors qu'en ASP ils sont interprétés ;</li>
<li>en ASP.NET le <a href="Code_source" title="Code source">code source</a> des programmes est séparé du contenu HTML, alors qu'en ASP ils sont mélangés ;</li>
<li>en ASP.NET la programmation est plus fortement <a href="Programmation_%C3%A9v%C3%A9nementielle" title="Programmation événementielle">événementielle</a> qu'en ASP.</li></ul>
<p>Ces différences simplifient la programmation, et permettent de réaliser plus facilement des applications web<sup id="cite_ref-liberty_2-2" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>. De plus <a href="Visual_Studio_.NET" class="mw-redirect" title="Visual Studio .NET">Visual Studio .NET</a> — l'outil destiné à créer des applications utilisant ASP.NET — comporte un <a href="D%C3%A9bogueur" title="Débogueur">débogueur</a>, un éditeur de page web <a href="WYSIWYG" class="mw-redirect" title="WYSIWYG">WYSIWYG</a>, un <a href="%C3%89diteur_de_texte" title="Éditeur de texte">éditeur de texte</a> avec <a href="Coloration_syntaxique" title="Coloration syntaxique">coloration syntaxique</a>, <a href="Autocompl%C3%A9tion" class="mw-redirect" title="Autocomplétion">autocomplétion</a> (technologie nommée IntelliSense) et vérification syntaxique en cours de frappe, ce qui simplifie encore davantage le travail de programmation<sup id="cite_ref-liberty_2-3" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Programmation">Programmation</h2></div>
<p>La programmation sur ASP.NET est orientée <i>événement</i>. Dans ce <a href="Style_de_programmation" title="Style de programmation">style de programmation</a> le système attend par exemple que l'utilisateur presse sur un bouton. Une fonction est associée à cet événement, et cette fonction sera exécutée automatiquement par le système lorsque l'utilisateur effectue l'action. En ASP.NET, la page web et la plupart des <a href="Composant_d'interface_graphique" title="Composant d'interface graphique">widgets</a> peuvent provoquer des événements. Des événements correspondent également au démarrage de l'application ou à la connexion d'un utilisateur. Des événements peuvent correspondre à des actions effectuées sur le navigateur web, qui peuvent être parfois traitées avec du retard, du fait qu'ASP.NET est exécuté par le serveur web<sup id="cite_ref-liberty_2-4" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.
</p><p>ASP.NET comporte plusieurs lots de widgets (<i>controls</i>) qui peuvent être utilisés dans les pages web<sup id="cite_ref-liberty_2-5" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>:
</p>
<ul><li>Html controls : les <a href="%C3%89l%C3%A9ment_HTML" title="Élément HTML">balises HTML</a> correspondant à des widgets tels que boutons d'action, des boutons radio ou des cases à cocher<sup id="cite_ref-liberty_2-6" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li>
<li>Html server controls : il s'agit des balises HTML qui peuvent être manipulées par programmation. De nombreuses balises html peuvent être converties en <i>Html server control</i> en leur ajoutant l'attribut <code>runat="server"</code><sup id="cite_ref-liberty_2-7" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li>
<li>ASP Web controls : ils offrent les mêmes possibilités que les balises HTML, mais une programmation plus simple. Les balises pour ces widgets commencent par les lettres <code>asp:</code>. exemple:<code><asp:Button ... runat="server" /></code>. Ces widgets sont transformées en HTML par ASP.NET avant d'être envoyés au navigateur web. Le résultat de la transformation peut différer selon le navigateur utilisé<sup id="cite_ref-liberty_2-8" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li>
<li>Parmi les "ASP Web controls", il y en a qui permettent d'afficher des tableaux contenant des données obtenues par programmation et d'autres qui permettent d'afficher un calendrier où l'utilisateur peut choisir une date<sup id="cite_ref-liberty_2-9" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li>
<li>Validation controls : ils offrent la possibilité d'effectuer des vérifications des actions de l'utilisateur<sup id="cite_ref-liberty_2-10" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li>
<li>"User controls" et "server controls" : il s'agit de widgets créés par les développeurs pour leurs besoins<sup id="cite_ref-liberty_2-11" class="reference"><a href="#cite_note-liberty-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>.</li></ul>
<p>Ce style de programmation est rendu possible par le <a href="Framework" title="Framework">framework</a> <i>Web forms</i> incorporé dans ASP.NET. Ce framework permet de mettre en œuvre une <a href="Interface_graphique" title="Interface graphique">interface graphique</a> à l'aide d'un groupe d'<a href="Objet_(informatique)" title="Objet (informatique)">objets</a> qui peuvent être transformés en HTML<sup id="cite_ref-freeman_6-0" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>. Par ce framework Microsoft a tenté de faire abstraction du langage <a href="HTML" class="mw-redirect" title="HTML">HTML</a> et du protocole <a href="HTTP" class="mw-redirect" title="HTTP">HTTP</a> auquel les ingénieurs n'étaient pas encore familiers<sup id="cite_ref-freeman_6-1" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>.
</p><p>Depuis 2009 ASP.NET comporte le <a href="Framework" title="Framework">framework</a> <a href="ASP.NET_MVC" title="ASP.NET MVC">ASP.NET MVC</a> comme alternative à <i>Web forms</i>. Celui-ci est inspiré de produits comme <a href="Ruby_on_Rails" title="Ruby on Rails">Ruby on Rails</a>, et destiné à pallier les limitations techniques de <i>Web forms</i><sup id="cite_ref-freeman_6-2" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>. Ce framework applique le style <a href="Mod%C3%A8le-Vue-Contr%C3%B4leur" class="mw-redirect" title="Modèle-Vue-Contrôleur">Modèle-Vue-Contrôleur</a> (abr. MVC) - un style lancé en 1978 et devenu populaire pour les applications web<sup id="cite_ref-freeman_6-3" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>. Alors que Web forms - du fait qu'il visait à faire abstraction du code HTML - offrait peu de contrôle, le framework ASP.Net MVC offre un contrôle complet du HTML généré par l'application web, ce qui simplifie l'utilisation de bibliothèques comme <a href="JQuery" title="JQuery">JQuery</a> ou <a href="Bootstrap_(framework)" title="Bootstrap (framework)">Bootstrap</a><sup id="cite_ref-freeman_6-4" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>. Contrairement à son prédécesseur, le code source d'ASP.Net MVC est publié sous <a href="Licence_libre" title="Licence libre">licence libre</a> <i>Microsoft Public License</i><sup id="cite_ref-freeman_6-5" class="reference"><a href="#cite_note-freeman-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Exemple_de_page_ASP.NET">Exemple de page ASP.NET</h3></div>
<dl><dt>Exemple utilisant <i>Web forms</i>.</dt></dl>
<p>Partie HTML :
</p>
<div class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><pre><span></span><span class="p"><</span><span class="nt">form</span> <span class="na">runat</span><span class="o">=</span><span class="s">"server"</span><span class="p">></span>
<span class="p"><</span><span class="nt">asp:Label</span> <span class="na">id</span><span class="o">=</span><span class="s">"lblMessage"</span> <span class="na">runat</span><span class="o">=</span><span class="s">"server"</span><span class="p">></</span><span class="nt">asp:Label</span><span class="p">></span>
<span class="p"></</span><span class="nt">form</span><span class="p">></span>
</pre></div>
<p>Partie code source (exemple en Visual Basic.NET) :
</p>
<div class="mw-highlight mw-highlight-lang-vbnet mw-content-ltr" dir="ltr"><pre><span></span><span class="k">Sub</span><span class="w"> </span><span class="nf">Page_Load</span><span class="p">()</span>
<span class="w"> </span><span class="n">lblMessage</span><span class="p">.</span><span class="n">Text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"Hello world!"</span>
<span class="k">End</span><span class="w"> </span><span class="k">Sub</span>
</pre></div><p><sup id="cite_ref-ullman_5-1" class="reference"><a href="#cite_note-ullman-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p><div class="mw-heading mw-heading3"><h3 id="Types_de_fichiers">Types de fichiers</h3></div>
<table class="wikitable">
<tbody><tr>
<th>extension</th>
<th>Utilisation</th>
<th>remarque
</th></tr>
<tr>
<td>.aspx</td>
<td>Les pages web ASP.NET</td>
<td>
</td></tr>
<tr>
<td>.asax</td>
<td>contient les récepteurs pour les événements en rapport avec l'application ou la session utilisateur</td>
<td>Un seul fichier <i>global.asax</i>
</td></tr>
<tr>
<td>.ascx</td>
<td>Les widgets créés par les programmeurs pour leurs besoins</td>
<td>
</td></tr>
<tr>
<td>.asmx</td>
<td>les <a href="Services_web" class="mw-redirect" title="Services web">services web</a> ASP.NET</td>
<td>
</td></tr>
<tr>
<td>.config</td>
<td>les fichiers de configuration au format <a href="XML" class="mw-redirect" title="XML">XML</a></td>
<td>le principal fichier est <i>web.config</i>
</td></tr>
<tr>
<td>.cs</td>
<td>code source en langage <a href="C_sharp" class="mw-redirect" title="C sharp">C#</a></td>
<td>
</td></tr>
<tr>
<td>.vb</td>
<td>code source en langage <a href="Visual_Basic_.NET" title="Visual Basic .NET">Visual Basic .NET</a></td>
<td>
</td></tr>
<tr>
<td>.js</td>
<td>scripts en langage <a href="Javascript" class="mw-redirect" title="Javascript">Javascript</a></td>
<td>
</td></tr></tbody></table><p><sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><div class="mw-heading mw-heading2"><h2 id="Fonctionnement">Fonctionnement</h2></div>
<p>Le moteur d'ASP.NET est un filtre, branché sur le service web IIS par son interface de programmation ISAPI<sup id="cite_ref-weissinger_3-3" class="reference"><a href="#cite_note-weissinger-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>. Le filtre — une <a href="Dynamic_Link_Library" title="Dynamic Link Library">DLL</a> — est chargé en mémoire à la première utilisation, puis pour chaque demande de page web il lit un modèle de page, puis exécute des instructions qui vont altérer le contenu de la page et renvoie le résultat à IIS, qui le transmet au client<sup id="cite_ref-weissinger_3-4" class="reference"><a href="#cite_note-weissinger-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>.
</p><p>L'interface ISAPI est également utilisée pour d'autres langages web tels que <a href="PHP" title="PHP">PHP</a> ou <a href="Perl_(langage)" title="Perl (langage)">Perl</a><sup id="cite_ref-krause_8-0" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>. Cette interface utilise la technologie <a href="Component_Object_Model" title="Component Object Model">COM</a>. Microsoft fournit très peu de documentation à son sujet<sup id="cite_ref-krause_8-1" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>.
</p><p>Le moteur ASP.NET fonctionne avec un pipeline de traitement des requêtes web: Lorsque l'utilisateur navigue sur un <a href="Hyperlien" title="Hyperlien">hyperlien</a>, une demande est envoyée au serveur web IIS. La demande traverse ensuite le pipeline d'ASP.NET jusqu'au point de sortie ou un développeur d'application peut attacher le code nécessaire au traitement de cette demande<sup id="cite_ref-krause_8-2" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>. Le moteur est indépendant du serveur web IIS<sup id="cite_ref-krause_8-3" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>.
</p><p>Lorsque le serveur web reçoit une demande de page web, il détermine tout d'abord s'il s'agit de contenu statique (enregistré dans un fichier) ou de contenu dynamique (généré sur demande)<sup id="cite_ref-mitchell_4-7" class="reference"><a href="#cite_note-mitchell-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. L'examen tient compte de l'extension du fichier. Selon la configuration, les fichiers qui se terminent par .aspx, .asax, .ascx, .ashx, .asmx, .axd ou .svc seront transmis à ASP.NET via aspnet_isapi.dll, une bibliothèque branchée à l'interface ISAPI de IIS. La requête sera envoyée à un récepteur différent selon son extension<sup id="cite_ref-krause_8-4" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>. ASP.NET exécute ensuite un programme, puis le résultat du programme est renvoyé au serveur web qui le transmettra au navigateur web à l'origine de la demande.
</p><p>Les pages web (.aspx) ainsi que des services web (.asmx) sont mis en œuvre en utilisant deux récepteurs intégrés à ASP.NET. Beaucoup de développeurs d'application se servent uniquement de ces deux récepteurs et le fait qu'il est possible pour les développeurs d'application de brancher leur propre récepteur est souvent inconnu ou pas maîtrisé<sup id="cite_ref-krause_8-5" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>. Le récepteur pour les fichiers .asmx est cependant dépassé par <a href="Windows_Communication_Foundation" title="Windows Communication Foundation">Windows Communication Foundation</a>, disponible depuis la version 3.0 du framework .NET<sup id="cite_ref-krause_8-6" class="reference"><a href="#cite_note-krause-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Quelques_exemples_d'applications"><span id="Quelques_exemples_d.27applications"></span>Quelques exemples d'applications</h2></div>
<ul><li><a href="Syst%C3%A8me_de_gestion_de_contenu" title="Système de gestion de contenu">Systèmes de gestion de contenu</a> (appelés aussi <i>CMS</i>) (<a href="DotNetNuke" title="DotNetNuke">DotNetNuke</a>, Umbraco, Altitude3.Net, etc.)</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> « <a rel="nofollow" class="external text" href="https://archive.wikiwix.com/cache/20151213115853/http://www.dotnetfoundation.org/aspnet-5"><cite style="font-style:normal;" lang="en">.NET Foundation</cite></a> », sur <span class="italique">dotnetfoundation.org via <a href="Wikiwix" title="Wikiwix">Wikiwix</a></span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2023-09-26" data-sort-value="2023-09-26">26 septembre 2023</time>)</small></span>.</span>
</li>
<li id="cite_note-liberty-2"><span class="reference-text">Jesse Liberty - Dan Hurwitz, <i>Programming ASP.NET</i>, "O'Reilly Media, Inc." . 2003, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9780596004873</span>)</small></span>
</li>
<li id="cite_note-weissinger-3"><span class="reference-text">Keyton Weissinger, <i>ASP in a Nutshell: A Desktop Quick Reference</i>, "O'Reilly Media, Inc." - 2000, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9781449379599</span>)</small></span>
</li>
<li id="cite_note-mitchell-4"><span class="reference-text">Scott Mitchell, <i>Sams Teach Yourself ASP.NET 4 in 24 Hours</i>, Pearson Education - 2010, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9780132171694</span>)</small></span>
</li>
<li id="cite_note-ullman-5"><span class="reference-text">Chris Ullman - John Kauffman - Chris Hart - David Sussman, <i>Beginning ASP.NET 1.1 with VB.NET 2003</i>, John Wiley & Sons - 2004, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9780764568855</span>)</small></span>
</li>
<li id="cite_note-freeman-6"><span class="reference-text"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> Adam Freeman, <i>Pro ASP.NET MVC 5</i>, Apress - 2014, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9781430265306</span>)</small></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><a href="#cite_ref-7">↑</a> </span><span class="reference-text">Steven A. Smith,<i>ASP.NET by Example</i>,Que Publishing - 2002, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9780789725622</span>)</small></span>
</li>
<li id="cite_note-krause-8"><span class="reference-text">Joerg Krause, <i>Pro ASP.NET Extensibility</i>, Apress - 2009, <small style="line-height:1em;">(<a href="International_Standard_Book_Number" title="International Standard Book Number">ISBN</a> <span class="nowrap">9781430219835</span>)</small></span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading2"><h2 id="Voir_aussi">Voir aussi</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Articles_connexes">Articles connexes</h3></div>
<ul><li><a href="Microsoft_.NET" title="Microsoft .NET">Microsoft .NET</a> L'architecture .NET</li>
<li><a href="Framework_.NET" class="mw-redirect" title="Framework .NET">framework .NET</a> Le framework .NET</li>
<li><a href="Mono_(logiciel)" title="Mono (logiciel)">Mono</a>, une implémentation libre du <a href="Framework_.NET" class="mw-redirect" title="Framework .NET">framework .NET</a></li>
<li><a href="ASPNET_Web_Matrix" title="ASPNET Web Matrix">ASPNET Web Matrix</a>, un outil de développement léger pour .NET</li></ul>
<div class="mw-heading mw-heading3"><h3 id="Liens_externes">Liens externes</h3></div>
<ul><li><a rel="nofollow" class="external text" href="http://www.asp.net/">ASP.NET</a> Le site de ASP.NET de Microsoft</li></ul>
<div class="navbox-container" style="clear:both;">
</div>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de Microsoft</span> </span></li> <li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de l’informatique</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2025-02-19" href="https://fr.wikipedia.org/wiki/?title=ASP.NET&oldid=223166848">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>
</body></html>